import { DataTableColumn } from 'naive-ui'
import { useCodeStore } from '@/store/modules/code'
import { Dict } from '@/enums'
import { formatTime } from '@/utils/common'

const codeStore = useCodeStore()

export const basicColumns: Array<DataTableColumn<Log>> = [
    {
        key: 'id',
        title: '编号'
    },
    {
        key: 'bizId',
        title: '业务编号'
    },
    {
        key: 'type',
        title: '类型',
        render(row){
            return codeStore.getName(Dict.LogType, row.type)
        }
    },
    {
        key: 'tableName',
        title: '表名'
    },
    {
        key: 'creator',
        title: '创建人'
    },
    {
        key: 'gmtCreate',
        title: '创建时间',
        render(row){
            return formatTime(row.gmtCreate)
        }
    }
]